const canvas = document.getElementById('webgl')
const gl = getWebGLContext(canvas)//使用封装好的，来适应不同brower

//顶点着色器 指定点的位置和尺寸
let VSHADER_SOURCE=
'void main(){\n'+
'    gl_Position = vec4(0.5,0.0,0.0,1.0);\n'+
'    gl_PointSize = 10.0;\n' +
'}\n'

//指定 点的颜色
let FSHADER_SOURCE = 
'void main(){\n' +
'    gl_FragColor = vec4(1.0,0.0,0.0,1.0);\n' +
'}\n'

function main(){
    gl.clearColor(0, 0, 0, 1)
    gl.clear(gl.COLOR_BUFFER_BIT)
    
    initShaders(gl, VSHADER_SOURCE,FSHADER_SOURCE)

    gl.drawArrays(gl.POINTS, 0, 1)
}
